<include file="Public/header"/>
<include file="Public/menu"/>

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            {$title}
            <small>{$title_two}</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> {$title}</a></li>
            <li class="active">{$title_two}</li>
        </ol>
    </section>
    <!-- 内容 -->
    <section class="content">

        <div class="tab-content">
            <div class="tab-pane active" id="tab_0">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title"></h3>
                        <div class="form-inline pull-right">
                            <form action="{:U('User/tempUser')}" method="get" pjax-container="">
                                <fieldset>
                                    <div class="input-group input-group-sm">
                                        <span class="input-group-addon"><strong>注册时间</strong>
                                        </span>
                                        <div class="col-sm-12 input-group-sm" style="padding: 0;">
                                        <input type="text" class="col-xm-6 form-control" style="border-radius: 0;" id="posttime" name="begintime" value="{$begintime}" data-rule="required;">
                                            <span class="col-xm-1 form-control" style="padding: 5px; border: none;">--</span>
                                        <input type="text" class="col-xm-6 form-control" id="business_endtime" name="endtime" value="{$endtime}" data-rule="required;">
                                            </div>
                                    </div>
                                    <div class="input-group input-group-sm" style="margin-right: 20px">
                                        <span class="input-group-addon"><strong>来源</strong>
                                        </span>
                                        <select name="source_id" class="form-control">
                                            <option value="0" >-请选择-</option>
                                            <foreach name="source" item="lv" key="lk" >
                                                <option value="{$lk}" <if condition="$source_id eq $lk "> selected = "selected"</if>>{$lv}</option>
                                            </foreach>
                                        </select>
                                    </div>
                                    <div class="input-group input-group-sm" style="margin-right: 20px">
                                        <span class="input-group-addon"><strong>认证</strong>
                                        </span>
                                        <select name="authentication" class="form-control">
                                            <option value="0" <if condition="$authentication eq '0' "> selected = "selected"</if>>全部</option>
                                            <option value="1" <if condition="$authentication eq '1' "> selected = "selected"</if>>已认证</option>
                                            <option value="2" <if condition="$authentication eq '2' "> selected = "selected"</if>>未认证</option>
                                        </select>
                                    </div>
                                    <select class="form-control" name="select" style="height: 30px; font-size: 12px;">
                                        <option value="t_u_id" <if condition="$select eq 't_u_id' "> selected = "selected"</if>>ID</option>
                                        <option value="nickname" <if condition="$select eq 'nickname' "> selected = "selected"</if>>昵称</option>

                                    </select>
                                    <div class="input-group input-group-sm">
                                        <div class="input-group input-group-sm">
                                            <input type="text" class="form-control" placeholder="" name="value" value="{$value}">
                                        </div>
                                    </div>

                                    <div class="input-group input-group-sm">
                                        <div class="input-group-btn">
                                            <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i>
                                            </button>
                                        </div>
                                    </div>
                                </fieldset>
                            </form>
                        </div>

                        <!-- <div class="btn-group pull-right" style="margin-right: 10px">
                             <a href="/admin/sakila/actors?_pjax=%23pjax-container&amp;_export=1" target="_blank"
                                class="btn btn-sm btn-warning"><i class="fa fa-download"></i>&nbsp;&nbsp;Export</a>
                         </div>-->

                        <!-- <div class="btn-group pull-right" style="margin-right: 10px">
                             <a href="{:U('Weixin/newTwoDBarcode')}" class="btn btn-sm btn-success"><i
                                     class="fa fa-save"></i>&nbsp;&nbsp;新增一个二维码配置</a>
                         </div>-->

                    </div>
                    <div class="text-danger" style="line-height: 1.8; padding: 7px; font-size: 14px;border-top:1px solid #f4f4f4; ">游客： 只是通过扫描店铺二维码进来浏览的用户</div>
                    <!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th><input type="checkbox" class="grid-select-all"></th>
                                <th>ID<a id="a_order" rank='{$rank}' onclick="rankId('id','{$rank}')" class="fa fa-fw fa-sort" href="javascript:void(0);"></a>
                                </th>
                                <th>昵称</th>
                                <th>来源</th>

                                <th>认证</th>
                                <th>生成时间</th>
                            </tr>
                            <foreach name="list" item="vo" >
                                <tr>
                                    <td><input type="checkbox" class="grid-item" data-id="{$vo.member_id}"></td>
                                    <td>{$vo.t_u_id}</td>
                                    <td>{$vo.nickname}</td>
                                    <td>{$source[$vo[source_id]]}</td>
                                    <td>{:search(array(1=>'已认证',2=>'未认证'),$vo['authentication'])}</td>
                                    <td>{$vo.regtime|date='Y-m-d H:i:s',###}</td>

                                </tr>
                            </foreach>

                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <!--<input type="checkbox" class="grid-select-all">&nbsp;&nbsp;&nbsp;
                        <a class="btn btn-sm btn-danger batch-delete">Batch delete</a>-->
                        {$page}
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>

        </div>
    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer"/>
<script type="text/javascript" src="/Public/admin/calendar/calendar.js"></script>
<link rel="stylesheet" type="text/css" href="/Public/admin/calendar/calendar-blue.css"/>
<script>

    var rankId = function(ran,order){
        window.location.href="{:U('User/tempUser')}"+"?begintime={$begintime}&endtime={$endtime}&source_id={$source_id}&authentication={$authentication}&select={$select}&value={$value}&"+ran+"="+order;
    }
    //冻结（解冻）
    var freezeMember = function(id,stat){
        if( (stat == 1) ? confirm('您确定要冻结该会员？') : confirm('您确定要解冻该会员？') ){
            $.post("{:U('User/freezeMember')}", { "id": id,"status": stat },
                    function(data){
                        if(data.stat){
                            alert(data.msg);
                            window.location.reload();
                        }else{
                            alert(data.msg);
                        }
                    }, "json");
        }
    }
    //时间控件
    date = new Date();
    Calendar.setup({
        inputField: "posttime",
        ifFormat: "%Y-%m-%d",
        showsTime: true,
        timeFormat: "24"
    });
    Calendar.setup({
        inputField: "business_endtime",
        ifFormat: "%Y-%m-%d",
        showsTime: true,
        timeFormat: "24"
    });
</script>